<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/11/27
  Time: 21:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
getContextPath():<%=request.getContextPath()%><br>
getServletPath():<%=request.getServletPath()%><br>
getRequestURI:<%=request.getRequestURI()%><br>
getRequestURL:<%=request.getRequestURL()%><br>
getServerName():<%=request.getServerName()%><br>
request.getScheme():<%=request.getScheme()%><br>
request.getServerPort():<%=request.getServerPort()%><br>
request.getRealPath("/"):<%=request.getRealPath("/")%><br>
request.getRealPath() 这个方法已经不推荐使用了，代替方法是：<br>

request.getSession().getServletContext().getRealPath():<%=session.getServletContext().getRealPath("index.jsp")%>
</body>
</html>
